IIM Commands Overview

Macro Commands



' <==   
If a line starts with " ' " everything behind the " ' " is ignored. Typically this is used for comments or to disable specific parts of a macro.



BACK    
Go BACK one step



CLEAR
Clear browser cache AND cookies. Useful for example to delete Web site cookies so every macro run starts at the some point.



CLICK X=123 Y=111 CONTENT=ABC
   
"Clicks" on the element at the specified X/Y coordinates. In contrast to WINCLICK, this click can be run in background mode. The optional CONTENT= attribute can be used to send text to the clicked element (e. g. if the clicked element is an input box)



CMDLINE <!VAR> <default value>    
Set the variable to a value retrieved from the command line. Use the-var1, -var2 and -var3 switches to set the variables from the command line.



DISCONNECT    
Disconnect the current dial-up connection. Tip: On Dial-Up connections DISCONNECT & REDIAL can be used to change IP addresses.



EXTRACT POS=1 ELEM=0 ATTR=(Anchor
*
)
Extract data from websites. Please note that the anchor normally ends with "*
". (ELEM is always 0, this value is reserved for later use)



FRAME F=<value>
Directs all following TAG or EXTRACT commands to the specified frame. The frame tag and number is automatically generated by clicking into a framed web page. Example macro: "Demo-Frames.iim"



EXTRACTPOPUP
Extract data from a popup. The text of a website popup is extracted. The text is processed the same way as standard EXTRACT text.



GOTOPOPUP
Continue recording inside a popup. [IIM Browser only]



LEAVEPOPUP
Close popup and go back to main page. [IIM Browser only]



ONPOPUP BUTTON=OK    
Instructs the Popup Manager to click the [OK] button for the next popup. This settings remains valid until changed with another "ONPOPUP" command.



PRINT
Print the current browser window.
Tip: If you want to print PDF files with the Acrobat Reader Plug-In, you need to add a "ONPOPUP
BUTTON=OK" command before the PRINT statement.




PROMPT <Text> <!VAR> <default value>
Display a popup to ask for a value. This value is stored in the variable.

Note: This command can be used with variables !VAR1, !VAR2 or !VAR3, but not with built-in variables like !DATASOURCE or dynamically generated variables from the "-var_X" command.



REDIAL YourISP
Redial a connection. "YourISP" is the name of your dialup connection as it appears in the Windows dialup selection.




REFRESH    
Refresh (Reload) current browser window



SAVEAS TYPE=FILE   
Save the file that is currently displayed in the browser. Typically this is the current Web page (HTML file) but it can also be a graphics file. A date & time stamp is automatically added to create a unique file name

SAVEAS TYPE=FOLDER
   
Save the current Web page, including graphics. A date & time stamp is automatically added to create a unique file name. This command brings up a "Save As" dialog that is handled by the Popup Manager.

SAVEAS TYPE=EXTRACT
   
Save extracted data to a file. This command must be used after the extract command itself. If several EXTRACT commands are used within one macro, the content is appended to the file. If a new macro is started, any file content is overwritten. The file name is defined with "SET !FILEEXTRACT yourfile.csv".



SET <!VAR> <value>
SET <BuiltInVAR> <value>
   
This command sets the variable !VAR1, !VAR2 or !VAR3 or one of the built-in variables to a certain value. Note: This command can be used with variables !VAR1, !VAR2 or !VAR3 or one of the built-in variables, but not with the dynamically generated variables from the "-var_X" command.

Available built-in variables:

Variable Name & Purpose

!DATASOURCE Input file for merging data
with macro. Example: SET !DATASOURCE c:\mysource.txt

!DDIR Download directory. Overrides the default download directory: Example: SET !DDIR c:\mynewdir\

!DEXT Download extensions. Change the file extensions that trigger the iOpus downloaded: Example: SET !DEXT exe*zip*mp3*csv*pdf
For permanent changes you can edit the default settings in the "iim.ini" settings file.

!DFILE Download file name. Normally this name is created automatically and consists of the download date, time and 30 characters of the web page title or file name. If you want to use a specific name for your download, you can set them with "SET !DFILE myfilename.htm".

!ERRORMACRO Overrides the global error macro setting in the option dialog for the current macro

!ERRORIGNORE (YES/NO) Tells IIM to ignore errors that can be safely ignored. For example TAG commands that are not found on the Web page.

!ENCRYPTION (YES/NO) Can be used to disable the use of password encryption for the current macro. Applies only to password fields on a Web page. (Password fields are the ones where words are displayed using asterisks ****).

!EXTRACT_TEST_POPUP (YES/NO). Set this value to NO to disable the extract testing popup that appears by default if you run a macro with an extract popup directly and not by using the command line or scripting interface.

!FILESTOPWATCH Set the file name for the file that contains the stopwatch measurement data. By default the file name is "stopwatch.csv" and is located in the download directory. You can use a name or a fully qualified path name. Example: SET !FILESTOPWATCH mynewfile.txt

!FILEEXTRACT Set the file name to save extracted data. By default the file name is "extract.csv" and is located in the download directory. You can use a name or a fully qualified path name. Example: SET !FILEEXTRACT mycurrency.txt .Alternatively you can use the Scripting Interface to access the extracted data.

!LOOP Counts the current loop in loop mode. Especially useful together with the POS=... attribute of the TAG command. See for example the "Demo-Slideshow" macro. With SET !LOOP 3 you can set a start value for the loop counter (the default value is 1). This is useful when you use the {{loop}} variable inside you macro and want to start with a value different from 1. SET !LOOP is ignored for every loop run except the first one.

!POINTER (YES/NO) Disable the pointer (blue frame) that marks the current position during a macro replay.

!POPUPMANAGER (YES/NO) Activate or stop the Windows Popup Manager (Do not confuse this with the HTML popup manager). Example: If you want your users to handle the print dialog manually, you can use SET !POPUPMANAGER NO before the PRINT command.

!REPLAYSPEED (1/2/3) Set the replay speed to fast(1), medium(2) or slow(3).

!TAGCHECK YES/NO: Switch the check for completed loaded web sites off. See for example Demo-FillVariousWebsites.

!TIMEOUT New timeout value in seconds. Overrides the Internet macro default value. Example: SET !TIMEOUT 150

!URLSTART The url that was active in the browser when the macro started. Typically used to go back to the start page inside the macro.




SIZE X=730 Y=655
   
Resize the IIM Browser Window (width, height in pixels). In Internet Explorer, this command is ignored. [PRO and SCRIPTING Editions only]




STOPWATCH ID=MyName    
Web site response time measurement. By default, the measured data is stored in the download directory of Internet Macros. You can change the file location with the !FILESTOPWATCH variable. [PRO and SCRIPTING Editions only]



TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:TestForm2 ATTR=NAME:Name CONTENT=Tom<SP>Tester

TAG POS=3 .....
TAG POS={{!LOOP}}
   
The TAG command:
Syntax: TAG TYPE=<Type of HTML element> FORM=<Form name> ATTR=<Identifier of element> CONTENT=<Content>
Example: This line fills an INPUT field with the name "name" with the text "Tom Tester"

Sometimes a web page can contain links with the same text, e. g. many links with the name "Download". This command tells IIM, to not use the first link it finds, but - for example - the 3rd link. When combined with the !LOOP variable it can be used to process on link after the other.

Special TAG commands for TYPE=SELECT:

By default, the CONTENT attribute of TYPE=SELECT stores the position (also called index) of value. But you can manually edit this to select ALL values of a multiple selection box. Also, to select the values by name add "$" before the name). Spaces must be written as <SP>. The comparison is case insensitive and wild cards like "*" can be used.

Example:
CONTENT=2:4 <= Normal selection (the position of a value is stored)
CONTENT=
$Apple<SP>Pie:$Fruits <= Selection by name (add $ before the name)
CONTENT=
$*apple*:$FRU*" <= Selection by name (wild cards, case insensitive comparison)
CONTENT=ALL <= select ALL values of a selection. Useful if the number of values changes dynamically

Special TAG commands for non-input fields (like the types A (link), B(bold) or IMG (image)):

Instead of a click on the element you can also ask IIM to fire other events, for example trigger a "mouseover" event to display a menu item. To do this, add a CONTENT attribute to the TAG line. Often these events are used to trigger Javascript menu items.
Example:
TAG POS=1 TYPE=IMG ATTR=HREF:http://www.iopus.com/images/menu1.gif CONTENT=EVENT:#MOUSEOVER

TYPE=FILE:
Internet Explorer and any other browser does not allow automatic filling of fiels with the type "file". Typically these fields are used for uploading files. However, Internet Macros can work around this limitation with the WINCLICK statement. More details can be found in the "Demo-FileUpload" macro.

TYPE=HIDDEN: Hidden fields are not displayed in the browser, so the TAG lines for them can not be generated during normal recordeding. But you can add TAG lines with type "HIDDEN" manually to the macro and IIM will fill these hidden fields during replay! Example: "TAG POS=1 TYPE=HIDDEN ATTR=..."




TRAPPOPUP Trap a new browser window and send it to the main page. This command is generated by the IE plugin and can be used in both, the IE plugin and the IIM browser.



URL GOTO=http://www.iOpus.com
Navigate to a URL . If the URL is of type "exe" or "zip" the file is automatically downloaded. The download extensions can be defined with the !DEXT variable.



WAIT SECONDS=33
Wait (s) seconds
   


VERSION BUILD=303805
Version that created this macro. Example: 303805 corresponds to Version 3.03 (Build 805).




WINCLICK X=123 Y=111 CONTENT=Hello<SP>World   
Triggers a "real" Windows click in the browser window. The advantage of this command is that it works with EVERY web page, even Java or Flash elements where the standard CLICK command fails. The CONTENT= attribute can be used to send text to the clicked element (e. g. if the clicked element is an input box) [PRO and SCRIPTING Editions only]